package com.ruoyi.demo.controller.demo;

import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.demo.domain.Address;
import com.ruoyi.demo.domain.GoodsType;
import com.ruoyi.demo.service.IAddressService;
import com.ruoyi.demo.service.IGoodsTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/goods_type")
public class GoodsTypeController {
    @Autowired
    private final IGoodsTypeService goodsTypeService;

    @GetMapping("/list")
    public TableDataInfo<GoodsType> list(){
        List<GoodsType> list = goodsTypeService.list();
        return TableDataInfo.build(list);
    }
}
